import { ElInput, ElPopover } from "element-plus";
import { PropType, defineComponent } from "vue";

const OrgTreeSelect = defineComponent({
  name: "OrgTreeSelect",
  emits: {
    "onUpdate:modelValue": (t: string) => {
      return typeof t === "string";
    },
  },
  props: {
    modelValue: String as PropType<string>,
  },
  setup(props, { emit }) {
    return () => (
      <ElPopover placement="bottom" trigger="click">
        <ElInput
          modelValue={props.modelValue}
          onUpdate:modelValue={(t) => emit("onUpdate:modelValue", t)}
        />
      </ElPopover>
    );
  },
});

export default OrgTreeSelect;
